/*
 * @Author: TC
 * @Date: 2025-06-20 16:00:52
 * @Last Modified by: TC
 * @Last Modified time: 2025-06-28 15:23:49
 */

import { app } from "db://assets/FrameWork/App";
import { ViewLogic } from "../Logic/ViewLogic";
import { Node, UITransform } from "cc";
import { BulletMotionLogic } from "../Logic/BuleltMotionLogic";

export class BattlerManager {
    //子弹层
    public bulletLayer: Node = null;
    //实体层
    public entityLayer: Node = null;
    public utfBulletLayer: UITransform = null;
    //路径逻辑
    private _motionLogic: BulletMotionLogic = null;
    public get motionLogic(): BulletMotionLogic {
        return this._motionLogic || (this._motionLogic = new BulletMotionLogic());
    }

    public init(): void {
        ViewLogic.setAnchor(0.5, 0.5);
        app.tickMgr.add(this);
    }

    public startBattle(): void {}
    public tick(dt: number): void {
        this.motionLogic.tick(dt);
    }
    /**
     * 释放
     */
    public release(): void {
        if (this._motionLogic) {
            this._motionLogic.release();
            this._motionLogic = null;
        }
    }
}
